home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 98 / CD-ROM 98.iso / infantil / tuxmath / tuxmath-2001.09.07-win32-installer.exe / src / tuxmath.c < prev   
Encoding:
C/C++ Source or Header  |  2001-08-28  |  923 b   |  57 lines

  1. /*
  2.   tuxmath.c
  3.  
  4.   Main function for TuxMath
  5.   Calls functions in other modules (eg, "setup", "title", "game", etc.)
  6.   as needed.
  7.  
  8.   Source code by Bill Kendrick, New Breed Software
  9.   bill@newbreedsoftware.com
  10.   http://www.newbreedsoftware.com/
  11.  
  12.   Part of "Tux4Kids" Project
  13.   http://www.tux4kids.org/
  14.   
  15.   August 26, 2001 - August 28, 2001
  16. */
  17.  
  18.  
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include "setup.h"
  22. #include "title.h"
  23. #include "game.h"
  24. #include "options.h"
  25. #include "credits.h"
  26.  
  27.  
  28. int main(int argc, char * argv[])
  29. {
  30.   int cmd, done;
  31.  
  32.  
  33.   setup(argc, argv);
  34.   
  35.   done = 0;
  36.   
  37.   do
  38.   {
  39.     cmd = title();
  40.  
  41.     if (cmd == CMD_GAME)
  42.       done = game();
  43.     else if (cmd == CMD_OPTIONS)
  44.       done = options();
  45.     else if (cmd == CMD_CREDITS)
  46.       done = credits();
  47.     else if (cmd == CMD_QUIT)
  48.       done = 1;
  49.   }
  50.   while (!done);
  51.   
  52.   SDL_Quit();
  53.  
  54.   return 0;
  55. }
  56.  
  57.